<?php

namespace JsonLowCode\Helps;


class Tools
{
    /**
     * 将英文字符串 [hello world, hello-world, hello_world, hello,world] 转成 HelloWorld
     * @param string $word
     * @param string $replace
     * @return string
     */
    public static function strToUcWords(string $word, string $replace = ""): string
    {
        $word = str_replace(["-","_",","]," ",$word);
        if ($replace){
            $word = str_replace($replace," ",$word);
        }
        return str_replace(" ","",ucwords($word));
    }
}
